home *** CD-ROM | disk | FTP | other *** search
/ The Arsenal Files 4 / The Arsenal Files 4 (Arsenal Computer).ISO / casm / au116-as.exe / IBMDOS / KEYBOARD.CPP < prev    next >
C/C++ Source or Header  |  1994-01-03  |  810b  |  46 lines

  1. #include "..\au.hpp"
  2. #include <conio.h>
  3. /*░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░*/
  4. char *keyboard_buffer(char *string)
  5. {
  6.     static char ret_string[30];
  7.     int ret_pos=0;
  8.  
  9.     while (kbhit())       // clear it while saving it
  10.     {
  11.         ret_string[ret_pos++] = my_getch();
  12.     }
  13.     ret_string[ret_pos] = '\0';
  14.  
  15.     while (*string != '\0')
  16.     {
  17.         _CL = *string;
  18.         _AH = 05;
  19.         __int__(0x16);
  20.         string++;
  21.     }
  22.     return ret_string;
  23. }
  24.  
  25. /************************************************************************/
  26. BYTE is_next_control_s()
  27. {
  28.     BYTE ascii;
  29.  
  30.     _AH = 1;
  31.     __int__(0x16);
  32.     asm JZ False;
  33.     ascii = _AL;
  34.     if (ascii == 0x13)
  35.         return TRUE;
  36.  
  37. #if 0
  38.     _CH = _AH;         /* Push it back on the buffer */
  39.     _CL = _AL;
  40.     _AH = 05;
  41.     __int__(0x16);
  42. #endif
  43. False:
  44.     return FALSE;
  45. }
  46.